#ifndef CLASSIFIERPRODUCTMODEL_H
#define CLASSIFIERPRODUCTMODEL_H

#include <QObject>
#include <QAbstractListModel>
#include "database/databasequery.h"

class ClassifierProductModel : public QAbstractListModel
{
    Q_OBJECT
public:
    explicit ClassifierProductModel(int colCnt,const QString& showName,QObject* parent);
    ~ClassifierProductModel();

    enum{
        ROLE_NAME = Qt::UserRole,
        ROLE_BARCODE,
        ROLE_R1_LOW,
        ROLE_R1_HI,
        ROLE_R2_LOW,
        ROLE_R2_HI,
        ROLE_R3_LOW,
        ROLE_R3_HI,
        ROLE_R4_LOW,
        ROLE_R4_HI,
        ROLE_R5_LOW,
        ROLE_R5_HI,
        ROLE_R6_LOW,
        ROLE_R6_HI,
        ROLE_R7_LOW,
        ROLE_R7_HI,
        ROLE_R8_LOW,
        ROLE_R8_HI,
        ROLE_R9_LOW,
        ROLE_R9_HI,
        ROLE_R10_LOW,
        ROLE_R10_HI,
        ROLE_R11_LOW,
        ROLE_R11_HI,
        ROLE_R12_LOW,
        ROLE_R12_HI
    };
    QString getTabName(){return mTabName;}
public slots:
    virtual bool submit();
    virtual bool submitFilter(const QString &str);
    // QAbstractItemModel interface
public:
    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
private:
    DataBaseQuery *mQuery;
    int mColumnCount;
    int mDataCount;
    QString mColumnName;
    QString mTabName;
};

#endif // CLASSIFIERPRODUCTMODEL_H
